﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace QuanLyKhachSan
{
    public partial class frmQuanLyTaiKhoan : Form
    {
        public frmQuanLyTaiKhoan()
        {
            InitializeComponent();
        }
        private void frmQuanLyTaiKhoan_Load(object sender, EventArgs e)
        {
            //Lấy giờ hệ thống
            string gio = DateTime.Now.ToLongTimeString();
            string ngay = DateTime.Now.ToLongDateString();
            string chuoi = ngay + " " + gio;
            txtNgayHienTai.Text = chuoi;
        }
        private void btnThem_Click(object sender, EventArgs e)
        {
            txtTenDangNhap.Enabled = true;
            txtMatKhau.Enabled = true;

            txtTenND.Enabled = true;
            txtHoND.Enabled = true;
            txtTenDemND.Enabled = true;
            txtDiaChi.Enabled = true;
            txtCMND.Enabled = true;
            cboLoaiNguoiDung.Enabled = true;

            btnLuu.Enabled = true;
        }

        private void btnXoa_Click(object sender, EventArgs e)
        {
            txtTenDangNhap.Enabled = true;
            txtMatKhau.Enabled = true;

            txtTenND.Enabled = true;
            txtHoND.Enabled = true;
            txtTenDemND.Enabled = true;
            txtDiaChi.Enabled = true;
            txtCMND.Enabled = true;
            cboLoaiNguoiDung.Enabled = true;


            btnLuu.Enabled = true;
        }

        private void btnLuu_Click(object sender, EventArgs e)
        {
            txtTenDangNhap.Enabled = false ;
            txtMatKhau.Enabled = false;

            txtTenND.Enabled = false;
            txtHoND.Enabled = false;
            txtTenDemND.Enabled = false;
            txtDiaChi.Enabled = false;
            txtCMND.Enabled = false;
            cboLoaiNguoiDung.Enabled = false;


            btnLuu.Enabled = false;
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void dgvDanhSachNguoiDung_SelectionChanged(object sender, EventArgs e)
        {

        }

        
    }
}